/**$Licence:
 *   Use this however/wherever you like, just don't blame me if it breaks anything.
 *   Copyright (C) 2008 - 2012 xingsheng.zhu@gmail.com All rights reserved.
 */
package com.blazemina.command;

import com.blazemina.exception.CreateCommandBeanException;
import com.blazemina.util.ClassUtils;

/**
 * @author JackChu
 * @version 1.0.0 2012-1-10 下午5:16:58
 */
public class DefaultJavaCommandFactory<C> implements CommandFactory{

	@Override
	public Object lookup(String commandClass) throws CreateCommandBeanException {
		Object command = null;
		try {
			command = ClassUtils.applicationInstance(commandClass);
		} catch (Exception e) {
			throw new CreateCommandBeanException("create command "+commandClass+" was not found", e);
		} 
		return command;
	}
	
	

}
